package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.dto.StaffRoleDto;
import com.dingreading.cloud.admin.dto.StaffRolesDto;
import com.dingreading.cloud.admin.entity.StaffRoles;
import com.dingreading.cloud.common.base.R;
import com.dingreading.cloud.common.util.PageUtil;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;

import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface StaffRolesService extends IService<StaffRoles> {

    Page<StaffRoleDto> pageList(PageUtil pageUtil, String storeUid, String keyword, Integer enabled);

    void updateEnabledByStoreUid(String headStaffUid, String headStaffName, String storeUid, Integer enabled);

    void updateEnabledByStaffUid(String headStaffUid, String headStaffName, String staffUid, Integer enabled);

    List<StaffRolesDto> getByStaffUid(String staffUid);

    StaffRolesDto getByIdDto(Long id);

    StaffRoles getByStaffUidAndStoreUid(String storeUid, String staffUid);

    R<Object> editRoleBean(
            String headStaffUid, String headStaffName, Long id, String storeUid, String staffUid,
            String roleName, List<Integer> roleList, Integer isHeadquarterStaff, Integer isStoreStaff, Integer inStoreService
    );

    boolean updateRoleBean(
            String headStaffUid, String headStaffName, String storeUid, String staffUid,
            String roleName, List<Integer> roleList, boolean superAdmin, Integer isHeadquarterStaff, Integer isStoreStaff, Integer inStoreService
    );

    R<Object> updateEnabled(String headStaffUid, String headStaffName, Long id, Integer enabled);

}
